package com.kuangstudy.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.kuangstudy.entity.Blog;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BlogMapper extends BaseMapper<Blog> {

    /**
     * @author zhangfushuai
     * @description 根据条件构造器，和分页条件查询文章
     * @since 2022/4/18 13:13
     * 参数 page
     * 参数 wrapper
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.kuangstudy.entity.Blog>
     **/
    IPage<Blog> findChildrenBlogByYear(IPage<Blog> page,@Param(Constants.WRAPPER) Wrapper<Blog> wrapper);

    /**
     * @author zhangfushuai
     * @description 分组查询对应的年份 [2019,2022,2023,2025,……]
     * @since 2022/4/18 13:12
     * 参数
     * @return java.util.List<java.lang.String>
     **/
    List<Integer> findBlogYearGroup();

}

